package com.example.homework;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.homework.activity.DeliveryAddressActivity;
import com.example.homework.activity.FileReadWriteActivity;
import com.example.homework.activity.GoodInfoActivity;
import com.example.homework.activity.ProductListActivity;
import com.example.homework.activity.RealTimeWeatherActivity;
import com.example.homework.activity.VideoViewActivity;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
    }

    public void onClickJumpGoodDetailButton(View view){
        Intent intent = new Intent(MainActivity.this, GoodInfoActivity.class);
        startActivity(intent);
    }
    public void onClickFileReadWriteButton(View view){
        Intent intent = new Intent(MainActivity.this, FileReadWriteActivity.class);
        startActivity(intent);
    }

    public void onClickVideoListButton(View view){
        Intent intent = new Intent(MainActivity.this, VideoViewActivity.class);
        startActivity(intent);
    }
    public void onClickDeliveryAddressButton(View view){
        Intent intent = new Intent(MainActivity.this, DeliveryAddressActivity.class);
        startActivity(intent);
    }

    public void onClickProductListButton(View view){
        Intent intent = new Intent(MainActivity.this, ProductListActivity.class);
        startActivity(intent);
    }

    public void onClickRealTimeWeather(View view) {
        Intent intent = new Intent(MainActivity.this, RealTimeWeatherActivity.class);
        startActivity(intent);
    }
}